package com.zx.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.io.Serializable;

/**
 * sys_user
 *
 * @author
 * @since 2021-11-25
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString
@TableName("sys_user")
public class User implements Serializable {

	private static final long serialVersionUID = 1L;

	/**
	 * 编号
	 */
	@TableId(type = IdType.AUTO)
	private Long usrId;

	/**
	 * 姓名
	 */
	private String usrName;

	/**
	 * 密码
	 */
	private String usrPassword;

	/**
	 * 角色编号
	 */
	private Long usrRoleId;

	/**
	 * 状态
	 */
	private Long usrFlag;

	/**
	 * 角色（一对一关系）
	 */
	@TableField(exist = false) // 屏蔽数据库字段与属性对应
	private Role role;

	public User(String usrName, String usrPassword) {
		this.usrName = usrName;
		this.usrPassword = usrPassword;
	}

	public User(String usrName, Long usrRoleId) {
		this.usrName = usrName;
		this.usrRoleId = usrRoleId;
	}

	public User(String usrName) {
		this.usrName = usrName;
	}
}
